Skip to content

refactor(ledger): move report bundle download to GraphQL reportDownloadUrl#131

Merged
jfrench9 merged 1 commit into
mainfrom
refactor/report-download-to-graphql
Jun 18, 2026
Merged

refactor(ledger): move report bundle download to GraphQL reportDownloadUrl#131
jfrench9 merged 1 commit into
mainfrom
refactor/report-download-to-graphql

Conversation

@jfrench9

Copy link
Copy Markdown
Member

Summary

Mirrors the backend change (robosystems #762, closes robosystems#751): the report serialization-bundle download moved from the retired GET …/reports/{id}/download REST resource to the GraphQL read surface (reportDownloadUrl). Every flavor now resolves to a presigned S3 URL — JSON-LD is stamped at publish time, XBRL is materialized + cached on first request — so XBRL no longer streams a zip through the download endpoint.

Changes

  • New GraphQL query (graphql/queries/ledger/__init__.py): GET_REPORT_DOWNLOAD_URL_QUERY + parse_report_download_url.
  • LedgerClient.download_report_bundle (clients/ledger_client.py): reimplemented to resolve the presigned URL via GraphQL reportDownloadUrl, then follow it for the bytes — for both flavors. Signature and ReportBundleDownload return shape are unchanged, so existing callers (including the example demos) need no code change. format still accepts the "jsonld" / "xbrl-2.1" wire values (mapped to the JSONLD / XBRL_2_1 enum names sent as the GraphQL variable).
  • Regenerated OpenAPI SDK: drops the dead get_report_bundle_download_url GET op and its response model. Also picks up incidental upstream description updates (create-taxonomy-block, create-information-block, schedule/entry request models) that the published 0.3.36 predated — not from this change.
  • Tests (tests/test_ledger_client.py): rewrote the bundle-download suite for the GraphQL + presigned-URL flow (both flavors follow the URL; report-not-found and presigned-URL-failure paths).

Breaking change

None to the SDK's public surface — download_report_bundle(graph_id, report_id, format=…, to=…, expires_in=…) keeps its signature and return type. The behavior change is internal (GraphQL instead of the REST endpoint; XBRL is now a presigned URL rather than a direct stream).

Testing

  • uv run pytest: 437 passed, 17 skipped (full suite).
  • Pre-commit hook: ruff check + ruff format + basedpyright (0 errors) + pytest — all green.

Notes / Follow-ups

  • After this is published, bump robosystems' pinned robosystems-client==0.3.36 to the new version (+ uv lock) and re-run the example demos to confirm end-to-end — the demo code itself is unchanged.

…adUrl

Mirror the backend change (robosystems #751/#762): the report
serialization-bundle download moved from the retired
`GET .../reports/{id}/download` REST resource to the GraphQL read
surface (`reportDownloadUrl`). Every flavor now resolves to a presigned
S3 URL — JSON-LD is stamped at publish time, XBRL is materialized +
cached on first request — so XBRL no longer streams a zip through the
download endpoint.

- add GET_REPORT_DOWNLOAD_URL_QUERY + parse_report_download_url
- reimplement LedgerClient.download_report_bundle to resolve the URL via
  GraphQL then follow it (both flavors); same signature + return shape,
  so callers (incl. the demos) are unaffected. `format` still accepts
  the "jsonld"/"xbrl-2.1" wire values (mapped to the enum names).
- regenerate the OpenAPI SDK (drops the dead download GET op + its
  model; also picks up incidental upstream description updates)
- rewrite the download tests for the GraphQL + presigned-URL flow
@jfrench9 jfrench9 merged commit b51cc96 into main Jun 18, 2026
1 check passed
@jfrench9 jfrench9 deleted the refactor/report-download-to-graphql branch June 18, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant